<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('我的已办列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                           	<li>
                                <label>主题：</label>
                                <input type="text" name="subject"/>
                            </li>
                           	<li>
                                <label>发起人：</label>
                                <input type="text" name="promoter"/>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-success" onclick="$.operate.examine()" shiro:hasPermission="ufli:todo:handle">
                    <i class="fa fa-check-circle"></i> 处理
                </a>
                <a class="btn btn-info single disabled" onclick="$.operate.flowchart()" shiro:hasPermission="ufli:todo:handle">
                    <i class="fa fa-share-alt"></i> 流程图
                </a>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "ufloTask";

        $(function() {
            var options = {
            	url: prefix + "/todoList",
                examineUrl: prefix + "/examine/{id}",
                modalName: "代办",
                columns: [{
                    checkbox: true
                },
                {
                    field: 'id',
                    title: 'id',
                    visible: false
                },
                {
                    field: 'subject',
                    title: '主题'
                },
                {
                    field: 'promoter',
                    title: '发起人'
                },
                {
                    field: 'upiCreateDate',
                    title: '发起时间'
                },
                {
                    field: 'nodeName',
                    title: '任务'
                },
                {
                    field: 'prevOpinion',
                    title: '备注'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs " href="javascript:void(0)" onclick="$.operate.examine(\'' + row.id + '\')"><i class="fa fa-check"></i>处理</a> ');
                        actions.push('<a class="btn btn-info btn-xs " href="javascript:void(0)" onclick="$.operate.flowchart(\'' + row.id + '\')"><i class="fa fa-share-alt"></i>流程图</a> ');
                        return actions.join('');
                    }
                }]
            };
            $.table.init(options);
        });
        
    </script>
</body>
</html>